package Frame.screen;

import FCRendering.FCRConstants;
import FCRendering.FCRMaster;
import FCRendering.ImageUtil;

import java.awt.*;

import static FCRendering.FCRMaster.*;
import static FCRendering.FCRMaster.fcv;

//全局菜单
public class DefaultInfoScreen extends IScreen{

    @Override
    public void dispatchPaintComponent(Graphics g, FCRMaster fcrMaster) {
        // 渲染菜单、信息等窗口
        g.setColor(Color.white);
        g.drawImage(ImageUtil.getImage("gameplayerinfo"), (int) (fcrMaster.getWidth() - 284 * fcv.getProportion()), 0,
                (int) (284 * fcv.getProportion()), (int) (135 * fcv.getProportion()), this);// 玩家信息
        g.setFont(new Font(FCRConstants.FONT_BLACK, 0, (int) (25 * fcv.getProportion())));
        g.drawString(player1.getLevelForString(), (int) (fcrMaster.getWidth() - 260 * fcv.getProportion()),
                (int) (40 * fcv.getProportion()));
        g.drawString(player1.getMoneyForString(), (int) (fcrMaster.getWidth() - 260 * fcv.getProportion()),
                (int) (70 * fcv.getProportion()));
        g.drawImage(charLib.getCharacterOfName(player1.getSelectPlayer()).getActionImage(0, 0, false),
                (int) (fcrMaster.getWidth() - 78 * fcv.getProportion()), (int) (14 * fcv.getProportion()), (int) (64 * fcv.getProportion()),
                (int) (64 * fcv.getProportion()), this);
        g.drawString(player1.getBloodForString(), (int) (fcrMaster.getWidth() - 260 * fcv.getProportion()),
                (int) (112 * fcv.getProportion()));// HP
        g.setColor(new Color(186, 186, 186));
        g.fillRect((int) (fcrMaster.getWidth() - 150 * fcv.getProportion()), (int) (95 * fcv.getProportion()), (int) (130 * fcv.getProportion()),
                (int) (18 * fcv.getProportion()));// 血条背景
        g.fillRect((int) (fcrMaster.getWidth() - 260 * fcv.getProportion()), (int) (115 * fcv.getProportion()), (int) (240 * fcv.getProportion()),
                (int) (3 * fcv.getProportion()));// 经验背景
        g.setColor(Color.red);
        g.fillRect((int) (fcrMaster.getWidth() - 150 * fcv.getProportion()), (int) (95 * fcv.getProportion()),
                (int) (130 * fcv.getProportion() * player1.getBloodPRO()), (int) (18 * fcv.getProportion()));// 血条
        g.setColor(new Color(0, 0, 196));
        g.fillRect((int) (fcrMaster.getWidth() - 260 * fcv.getProportion()), (int) (115 * fcv.getProportion()),
                (int) (240 * fcv.getProportion() * player1.getExperiencePRO()), (int) (3 * fcv.getProportion()));// 经验
        g.setColor(Color.white);
        g.fillRect((int) (fcrMaster.getWidth() - 145 * fcv.getProportion()), (int) (98 * fcv.getProportion()), (int) (120 * fcv.getProportion()),
                (int) (2 * fcv.getProportion()));// 血槽反光
      }

    @Override
    public void setBounds() {

    }
}
